package org.opensourcedea.ui.osdeagui;

public class TestProcessThread implements Runnable {
	
	//in ms
	private static final int TIMER_INTERVAL = 1000;
	private DEAProblemView mainView;
	
	public TestProcessThread(DEAProblemView initialView) {
		this.mainView = initialView;
	}

	public void go(){  
		  
		Thread t = new Thread(this); 
		t.start();  
		  
	}  
	
	
	@Override
	public void run() {  
		int counter = 0;  
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {  
			while(mainView != null){  
				mainView.updateLabelText("Counter = " + counter);  
				counter++;  
				Thread.sleep(TIMER_INTERVAL);  
			}  
		}
		catch (InterruptedException e) {  
			e.printStackTrace();  
		}  
	} 

}
